package com.longdaji.decoration.ui.news;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.util.Log;
import android.view.View;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.longdaji.decoration.R;
import com.longdaji.decoration.base.BaseActivity;
import com.longdaji.decoration.yunxin.SessionHelper;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Created by longtao on 2017/12/19.
 */

public class InfoActivity extends BaseActivity implements InfoContract.View {

    private static final String TAG = InfoActivity.class.getSimpleName();
    @BindView(R.id.tv_title)
    TextView mTvTitle;
    @BindView(R.id.llyt_logistics)
    LinearLayout mLlytLogistics;
//    @BindView(R.id.recycler_view_news)
//    RecyclerView mRecyclerViewNews;
    // List<NewsType> mNewsTypeList = new ArrayList<>();

    public static Intent getStartIntent(Context context) {
        Intent intent = new Intent(context, InfoActivity.class);
        return intent;
    }

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Log.d(TAG, "ScoreLotteryActivity onCreate");
        setContentView(R.layout.activity_info);
        setUnBinder(ButterKnife.bind(this));
        initView();
    }

    private void initView() {
        mTvTitle.setText("消息");
        // initReclerView();
    }

//    private void initReclerView() {
//        initNewsTypeList();
//        LinearLayoutManager layoutManager = new LinearLayoutManager(this);
//        mRecyclerViewNews.setLayoutManager(layoutManager);
//        InfoTypeAdapter adapter = new InfoTypeAdapter(mNewsTypeList);
//        mRecyclerViewNews.setAdapter(adapter);
//        DividerItemDecoration divider=new DividerItemDecoration(this,DividerItemDecoration.VERTICAL);
//        divider.setDrawable(ContextCompat.getDrawable(this,R.drawable.recyclerview_divider));
//        mRecyclerViewNews.addItemDecoration(divider);
//    }

//    private void initNewsTypeList() {
//        mNewsTypeList.add(new NewsType("物流通知", R.mipmap.logistics_news));
//        mNewsTypeList.add(new NewsType("在线客服", R.mipmap.service_news));
//        mNewsTypeList.add(new NewsType("系统通知", R.mipmap.system_news));
//    }

    @OnClick({R.id.iv_back, R.id.llyt_logistics, R.id.llyt_server2, R.id.llyt_server3})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.iv_back:
                finish();
                break;
            case R.id.llyt_logistics:
                // startActivity(LogisticsActivity.getStartIntent(InfoActivity.this));
                SessionHelper.startP2PSession(this, "taoxin1");
                break;
            case R.id.llyt_server2:
                // startActivity(LogisticsActivity.getStartIntent(InfoActivity.this));
                SessionHelper.startP2PSession(this, "taoxin2");
                break;
            case R.id.llyt_server3:
                // startActivity(LogisticsActivity.getStartIntent(InfoActivity.this));
                SessionHelper.startP2PSession(this, "taoxin3");
                break;
            default:
                break;
        }
    }
}
